
operation_point.o:     file format elf64-littleaarch64


Disassembly of section .text:

0000000000000000 <main>:
#include <stdio.h>



int main(void)
{
   0:	a9bc7bfd 	stp	x29, x30, [sp, #-64]!
   4:	910003fd 	mov	x29, sp
	int urn[5] = {100, 200, 300, 400, 500};
   8:	90000000 	adrp	x0, 0 <main>
   c:	91000000 	add	x0, x0, #0x0
  10:	910083a2 	add	x2, x29, #0x20 ; urn
  14:	aa0003e3 	mov	x3, x0
  18:	a9400460 	ldp	x0, x1, [x3]
  1c:	a9000440 	stp	x0, x1, [x2]
  20:	b9401060 	ldr	w0, [x3, #16]
  24:	b9001040 	str	w0, [x2, #16]
	int *ptr1, *ptr2, *ptr3;

	ptr1 = urn;
  28:	910083a0 	add	x0, x29, #0x20 ; urn
  2c:	f9000fa0 	str	x0, [x29, #24] ; ptr1
	ptr2 = &urn[2];
  30:	910083a0 	add	x0, x29, #0x20 ; urn
  34:	91002000 	add	x0, x0, #0x8   ; urn + 8
  38:	f9000ba0 	str	x0, [x29, #16] ; ptr2

	printf("pointer value, dereferenced pointer, pointer address:\n");
  3c:	90000000 	adrp	x0, 0 <main>
  40:	91000000 	add	x0, x0, #0x0
  44:	94000000 	bl	0 <puts>
	printf("ptr1 = %p, *ptr1 = %d, &ptr1 = %p\n", ptr1, *ptr1, &ptr1);	// 100
  48:	f9400fa1 	ldr	x1, [x29, #24]                               ; ptr1
  4c:	f9400fa0 	ldr	x0, [x29, #24]                               ; ptr1
  50:	b9400002 	ldr	w2, [x0]                                     ; *ptr1
  54:	910063a3 	add	x3, x29, #0x18                               ; ptr1
  58:	90000000 	adrp	x0, 0 <main>
  5c:	91000000 	add	x0, x0, #0x0
  60:	94000000 	bl	0 <printf>

	// pointer addition   + 
	ptr3 = ptr1 + 4;
  64:	f9400fa0 	ldr	x0, [x29, #24] ; ptr1
  68:	91004000 	add	x0, x0, #0x10  ; urn
  6c:	f9001fa0 	str	x0, [x29, #56] ; ptr3
		printf("\t==xiaozi ==== %d\n", *ptr3);	// 500
  70:	f9401fa0 	ldr	x0, [x29, #56]       ; ptr3
  74:	b9400001 	ldr	w1, [x0]             ; *ptr3
  78:	90000000 	adrp	x0, 0 <main>
  7c:	91000000 	add	x0, x0, #0x0
  80:	94000000 	bl	0 <printf>
		
	printf("\n adding an int to a pointer:\n");
  84:	90000000 	adrp	x0, 0 <main>
  88:	91000000 	add	x0, x0, #0x0
  8c:	94000000 	bl	0 <puts>
	printf("ptr1 + 4 = %p, *(ptr4 + 3) = %d\n", 
  90:	f9400fa0 	ldr	x0, [x29, #24]
  94:	91004001 	add	x1, x0, #0x10
				ptr1 + 4, *(ptr1 + 3));	// 400
  98:	f9400fa0 	ldr	x0, [x29, #24]
  9c:	91003000 	add	x0, x0, #0xc ; ptr1 + 0xc
	printf("ptr1 + 4 = %p, *(ptr4 + 3) = %d\n", 
  a0:	b9400002 	ldr	w2, [x0]
  a4:	90000000 	adrp	x0, 0 <main>
  a8:	91000000 	add	x0, x0, #0x0
  ac:	94000000 	bl	0 <printf>
				

	ptr1++;			// increase by degrees point    dizeng point
  b0:	f9400fa0 	ldr	x0, [x29, #24] ; ptr1
  b4:	91001000 	add	x0, x0, #0x4   ; ptr1+4
  b8:	f9000fa0 	str	x0, [x29, #24]
		printf("\t==xiaozi ==== %d\n", *ptr1);	// 200
  bc:	f9400fa0 	ldr	x0, [x29, #24]
  c0:	b9400001 	ldr	w1, [x0] ; *ptr1
  c4:	90000000 	adrp	x0, 0 <main>
  c8:	91000000 	add	x0, x0, #0x0
  cc:	94000000 	bl	0 <printf>
		
	printf("\n values after ptr1++\n");
  d0:	90000000 	adrp	x0, 0 <main>
  d4:	91000000 	add	x0, x0, #0x0
  d8:	94000000 	bl	0 <puts>
	printf("ptr1 = %p, *ptr1 = %d, &ptr1 = %p\n", 
  dc:	f9400fa1 	ldr	x1, [x29, #24] ; ptr1
  e0:	f9400fa0 	ldr	x0, [x29, #24] ; ptr1
  e4:	b9400002 	ldr	w2, [x0]       ; *ptr1
  e8:	910063a3 	add	x3, x29, #0x18
  ec:	90000000 	adrp	x0, 0 <main>
  f0:	91000000 	add	x0, x0, #0x0
  f4:	94000000 	bl	0 <printf>
				ptr1, *ptr1, &ptr1);	// 200

	ptr2--;			// descending		diqian point
  f8:	f9400ba0 	ldr	x0, [x29, #16]
  fc:	d1001000 	sub	x0, x0, #0x4 ; ptr2--
 100:	f9000ba0 	str	x0, [x29, #16]
	printf("\n values after --ptr2\n");
 104:	90000000 	adrp	x0, 0 <main>
 108:	91000000 	add	x0, x0, #0x0
 10c:	94000000 	bl	0 <puts>
	printf("ptr2 = %p, *ptr2 = %d, &ptr2 = %p\n", 
 110:	f9400ba1 	ldr	x1, [x29, #16]
 114:	f9400ba0 	ldr	x0, [x29, #16]
 118:	b9400002 	ldr	w2, [x0] ; *ptr2
 11c:	910043a3 	add	x3, x29, #0x10
 120:	90000000 	adrp	x0, 0 <main>
 124:	91000000 	add	x0, x0, #0x0
 128:	94000000 	bl	0 <printf>
				ptr2, *ptr2, &ptr2);	// 200

	--ptr1;			// huifu wei chu shi zhi
 12c:	f9400fa0 	ldr	x0, [x29, #24]
 130:	d1001000 	sub	x0, x0, #0x4
 134:	f9000fa0 	str	x0, [x29, #24]
	++ptr2;			// huifu wei chu shi zhi
 138:	f9400ba0 	ldr	x0, [x29, #16]
 13c:	91001000 	add	x0, x0, #0x4
 140:	f9000ba0 	str	x0, [x29, #16]
		printf("\t==xiaozi ==== %d\n", *ptr1);	// 100
 144:	f9400fa0 	ldr	x0, [x29, #24]
 148:	b9400001 	ldr	w1, [x0]
 14c:	90000000 	adrp	x0, 0 <main>
 150:	91000000 	add	x0, x0, #0x0
 154:	94000000 	bl	0 <printf>
		printf("\t==xiaozi ==== %d\n", *ptr2);	// 300
 158:	f9400ba0 	ldr	x0, [x29, #16]
 15c:	b9400001 	ldr	w1, [x0]
 160:	90000000 	adrp	x0, 0 <main>
 164:	91000000 	add	x0, x0, #0x0
 168:	94000000 	bl	0 <printf>
	printf("\n pointers reset to original values:\n");
 16c:	90000000 	adrp	x0, 0 <main>
 170:	91000000 	add	x0, x0, #0x0
 174:	94000000 	bl	0 <puts>
	printf("ptr1 = %p, ptr2 = %p\n", 
 178:	f9400fa1 	ldr	x1, [x29, #24]
 17c:	f9400ba2 	ldr	x2, [x29, #16]
 180:	90000000 	adrp	x0, 0 <main>
 184:	91000000 	add	x0, x0, #0x0
 188:	94000000 	bl	0 <printf>
					ptr1, ptr2);	// 300

	// yige point qianqu ling yige point
	printf("\n subtracting one pointer from another:\n");
 18c:	90000000 	adrp	x0, 0 <main>
 190:	91000000 	add	x0, x0, #0x0
 194:	94000000 	bl	0 <puts>
	printf("ptr2 = %p, ptr1 = %p, ptr2 - ptr1 = %d\n", 
 198:	f9400ba1 	ldr	x1, [x29, #16]
 19c:	f9400fa2 	ldr	x2, [x29, #24]
						ptr2, ptr1, ptr2 - ptr1); // 2
 1a0:	f9400ba0 	ldr	x0, [x29, #16]
 1a4:	aa0003e3 	mov	x3, x0
 1a8:	f9400fa0 	ldr	x0, [x29, #24]
 1ac:	cb000060 	sub	x0, x3, x0
	printf("ptr2 = %p, ptr1 = %p, ptr2 - ptr1 = %d\n", 
 1b0:	9342fc00 	asr	x0, x0, #2
 1b4:	aa0003e3 	mov	x3, x0
 1b8:	90000000 	adrp	x0, 0 <main>
 1bc:	91000000 	add	x0, x0, #0x0
 1c0:	94000000 	bl	0 <printf>


	// yige point qianqu yige zhengshu
	printf("\n subtracting an int from a pointer:\n");
 1c4:	90000000 	adrp	x0, 0 <main>
 1c8:	91000000 	add	x0, x0, #0x0
 1cc:	94000000 	bl	0 <puts>
	printf("ptr3 = %p, ptr3 - 2 = %p\n", 
 1d0:	f9401fa0 	ldr	x0, [x29, #56]
 1d4:	d1002001 	sub	x1, x0, #0x8
 1d8:	90000000 	adrp	x0, 0 <main>
 1dc:	91000000 	add	x0, x0, #0x0
 1e0:	aa0103e2 	mov	x2, x1
 1e4:	f9401fa1 	ldr	x1, [x29, #56]
 1e8:	94000000 	bl	0 <printf>
 1ec:	52800000 	mov	w0, #0x0                   	// #0
					ptr3, ptr3 - 2);

}
 1f0:	a8c47bfd 	ldp	x29, x30, [sp], #64
 1f4:	d65f03c0 	ret
